package com.aitaoxue.palx.ui;

import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;

import com.aitaoxue.palx.R;
import com.aitaoxue.palx.base.BaseActivity;
import com.aitaoxue.palx.fragment.AddCourseFragment;
import com.aitaoxue.palx.fragment.MyCourseFragment;

public class MyCourseActivity extends BaseActivity {

	FragmentManager manager;
	
	public FragmentManager getManager() {
		return manager;
	}

	public void setManager(FragmentManager manager) {
		this.manager = manager;
	}

	@Override
	protected boolean hasBackButton() {
		return true;
	}

	@Override
	protected int getActionBarTitle() {
		return R.string.my_course;
	}

	@Override
	protected int getLayoutId() {
		return R.layout.activity_my_course;
	}

	@Override
	public void onClick(View v) {

	}

	@Override
	public void initView() {
		manager = getSupportFragmentManager();
		FragmentTransaction tr = manager.beginTransaction();
		MyCourseFragment fragment=new MyCourseFragment();
		tr.replace(R.id.container, fragment);
		tr.commit();
	}

	@Override
	public void initData() {

	}
	
	
	public void changeToMyCourseFragment(){
		FragmentTransaction tr=manager.beginTransaction();
		tr.replace(R.id.container, new MyCourseFragment());
		tr.commit();
	}

}
